<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="../commons/list.jsp"%>
<html>
<head>
    <meta charset="utf-8">
    <!-- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> -->
    <link rel="shortcut icon" href="<%=basePath%>common/img/car.ico" type="image/x-icon"/> 
    <title>汽车机器人</title>
</head>

<body class="kit-theme">
    <div class="layui-layout layui-layout-admin kit-layout-admin">
        <div class="layui-header">
            <div class="layui-logo">汽车机器人</div>
            <div class="layui-logo kit-logo-mobile">CAR</div>
            <!-- <ul class="layui-nav layui-layout-left kit-nav" kit-one-level>
                <li class="layui-nav-item"><a href="javascript:;">控制台</a></li>
                <li class="layui-nav-item"><a href="javascript:;">商品管理</a></li>
            </ul> -->
            <%-- <div style="width: 15%;height: 100%;float: left;margin-left: 10px;padding-left: 250px;padding-top: 20px">
		   		<span style="word-spacing: nowrap">${user.username }欢迎登陆</span>
		   </div> --%>
            <ul class="layui-nav layui-layout-right kit-nav">
             	<li class="layui-nav-item">
               		<iframe scrolling="no" src="https://tianqiapi.com/api.php?style=ta&skin=cucumber" frameborder="0" width="260" height="24" allowtransparency="true"></iframe>
               	</li> 
                <!-- <li class="layui-nav-item"><a href="javascript:;" id="pay"><i class="fa fa-gratipay" aria-hidden="true"></i> 捐赠我</a></li> -->
                <li class="layui-nav-item">
                    <a href="javascript:;">
                        <img src="http://m.zhengjinfan.cn/images/0.jpg" class="layui-nav-img"> ${user.username }
                    </a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:changePassword();">更改密码</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item"><a href="javascript:loginOut();"><i class="fa fa-sign-out" aria-hidden="true"></i> 注销</a></li>
            </ul>
        </div>

        <jsp:include page="./menu.jsp"/>
        
        <div class="layui-body" id="container">
            <!-- 内容主体区域 -->
            <div style="padding: 15px;">主体内容加载中,请稍等...</div>
        </div>

      <!--   <div class="layui-footer">
            底部固定区域
            2017 &copy;
            <a href="http://kit.zhengjinfan.cn/">kit.zhengjinfan.cn/</a> MIT license

        </div> -->
    </div>
   <!--  <script type="text/javascript">
        var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");
        document.write(unescape("%3Cspan id='cnzz_stat_icon_1264021086'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s22.cnzz.com/z_stat.php%3Fid%3D1264021086%26show%3Dpic1' type='text/javascript'%3E%3C/script%3E"));
    </script> -->
    
    <script>
        var message;
        layui.config({
            base: '<%=basePath%>common/build/js/'
        }).use(['app', 'message'], function() {
            var app = layui.app,
                $ = layui.jquery,
                layer = layui.layer;
            //将message设置为全局以便子页面调用
            message = layui.message;
            //主入口
            app.set({
                type: 'iframe'
            }).init();
            $('#pay').on('click', function() {
                layer.open({
                    title: false,
                    type: 1,
                    content: '<img src="<%=basePath%>common/build/images/pay.png" />',
                    area: ['500px', '250px'],
                    shadeClose: true
                });
            });
        });
        
        //注销
        function loginOut(){
        	layer.confirm('是否确定注销系统?', {icon: 3, title:'提示'}, function(index){
        		  layer.close(index);
        		  //发送请求，销毁系统的session
        		  $.ajax({
			        type : 'GET',
			        url : '<%=basePath%>controller/login/loginOut',
			        cache : false,
			        success : function submitSuccess(data){
			        	//然后刷新页面到登录页面
		        		location.href = '<%=basePath%>controller/login/login';
		    		}
        		});
        	})
        }
        
        function openPage(url){
        	 //打开页面
	  		  layer.open({
	  			  type: 2, 
	  			  content: url, 
	  			  maxmin: true,
	  			  area: ['1200px', '700px']
	  		  }); 
        }
        
        function changePassword(){
        	//打开页面
	  		  layer.open({
	  			  type: 2, 
	  			  content: '<%=basePath%>controller/sysUser/changePassword/', 
	  			  maxmin: true,
	  			  area: ['600px', '400px']
	  		  }); 
        }
        
        function toLogin(){
        	layer.closeAll(); //疯狂模式，关闭所有层
        	 $.ajax({
     	        type : 'GET',
     	        url : '<%=basePath%>controller/login/loginOut',
     	        cache : false,
     	        success : function submitSuccess(data){
     	        	//然后刷新页面到登录页面
             		location.href = '<%=basePath%>controller/login/login';
         		}
     		});
        }
    </script>
</body>

</html>